<template>
	<view class="all">
		  <view class="chuangjiangonghui">
			  <input v-model="gonghuiming" placeholder="公会名"/>
			  <input v-model="jianshu" placeholder="简述"/>
			  <button class="chuangjian" @click="chuangjian" type="primary">创建公会</button>
		  </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				gonghuiming:'',
				jianshu:'',
				zhang:'',
				jieguo:''
			}
		},
		created(){
		this.zhang=getApp().globalData.zhang	
		},
		methods: {
			async chuangjian(){
				uni.request({
					url:"http://124.221.104.5:8080/jbgn/chuangjiangonghui",
					data:{gonghuiming:this.gonghuiming,jianshu:this.jianshu,huizhang:this.zhang},
					success: (res) => {
							this.jieguo=res.data
					}
				})
				await new Promise((res)=>setTimeout(res,500))
			uni.showToast({
					        title: this.jieguo,
							duration:1000,
							icon:"none"
				                })
			    }
		}
	}
</script>

<style>
	.all{
		position: absolute;
	 width: 601rpx;
			height: 378rpx;
	margin-left:150rpx ;
	top: 0%;
	}
	.chuangjiangonghui{
		display: flex;
		flex-direction: column;
	    align-items: center;
		margin-top: 80rpx;
	}
	.chuangjiangonghui input{
		width: 250rpx;
		height: 50rpx;
		border: 1rpx solid aquamarine;
		margin-top: 10rpx;
	}
	.chuangjian{
		margin-top: 30rpx;
	}
	

</style>
